/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 12, 2011    @time-created 6:57:41 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.AccessRight;
import util.enumeration.Language;

public class LocalizedAccessRight {

    // alphabetical order
    public static String getLocalizedAccessRightAsString(AccessRight accessRight, String locale) {
        String localizedAccessRight = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedAccessRight = getAccessRight_EN_US(accessRight);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedAccessRight = getAccessRight_EN_SG(accessRight);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedAccessRight = getAccessRight_MS_MY(accessRight);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedAccessRight = getAccessRight_ZH_CN(accessRight);
        }
        // other language...
        else {
            localizedAccessRight = getAccessRight_EN_US(accessRight);
        }
        
        return localizedAccessRight;
    }
    
    // simplified chinese (zh_CN)
    private static String getAccessRight_ZH_CN(AccessRight accessRight) {
        String localizedAccessRight = "";
        
        switch (accessRight) {
            case ADD_TCUBE_USER: localizedAccessRight = "加入雇员用户" ; break;
            case DELETE_TCUBE_USER: localizedAccessRight = "删除TCube用户"; break;
            case EDIT_ACCESS_RIGHTS: localizedAccessRight = "编辑存取权限"; break;
            case UNLOCK_ACCOUNTS: localizedAccessRight = "解锁帐户"; break;
            case INACTIVATE_ACCOUNTS: localizedAccessRight = "灭活帐户"; break;
            case VERIFY_STAKEHOLDER_ACCOUNTS: localizedAccessRight = "认利益相关者的帐户"; break;
            case MANAGE_MAILBOX: localizedAccessRight = "管理邮箱"; break;
            case VIEW_ALL_STAFF: localizedAccessRight = "浏览所有工作人员"; break;
        }
        return localizedAccessRight;
    }
    
    // default (en_US)
    private static String getAccessRight_EN_US(AccessRight accessRight) {
        String localizedAccessRight = "";
        
        switch (accessRight) {
            case ADD_TCUBE_USER: localizedAccessRight = "Add TCube User" ; break;
            case DELETE_TCUBE_USER: localizedAccessRight = "Delete TCube User"; break;
            case EDIT_ACCESS_RIGHTS: localizedAccessRight = "Edit Access Rights"; break;
            case UNLOCK_ACCOUNTS: localizedAccessRight = "Unlock Accounts"; break;
            case INACTIVATE_ACCOUNTS: localizedAccessRight = "Inactivate Accounts"; break;
            case VERIFY_STAKEHOLDER_ACCOUNTS: localizedAccessRight = "Verify Stakeholder Accounts"; break;
            case MANAGE_MAILBOX: localizedAccessRight = "Manage MailBox"; break;
            case VIEW_ALL_STAFF: localizedAccessRight = "View All Staff"; break;
        }
        return localizedAccessRight;
    }
    
    // singapore english (en_SG)
    private static String getAccessRight_EN_SG(AccessRight accessRight) {
        String localizedAccessRight = "";
        
        switch (accessRight) {
            case ADD_TCUBE_USER: localizedAccessRight = "Add TCube User" ; break;
            case DELETE_TCUBE_USER: localizedAccessRight = "Delete TCube User"; break;
            case EDIT_ACCESS_RIGHTS: localizedAccessRight = "Edit Access Rights"; break;
            case UNLOCK_ACCOUNTS: localizedAccessRight = "Unlock Accounts"; break;
            case INACTIVATE_ACCOUNTS: localizedAccessRight = "Inactivate Accounts"; break;
            case VERIFY_STAKEHOLDER_ACCOUNTS: localizedAccessRight = "Verify Stakeholder Accounts"; break;
            case MANAGE_MAILBOX: localizedAccessRight = "Manage MailBox"; break;
            case VIEW_ALL_STAFF: localizedAccessRight = "View All Staff"; break;
        }
        return localizedAccessRight;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getAccessRight_MS_MY(AccessRight accessRight) {
        String localizedAccessRight = "";
        
        switch (accessRight) {
            case ADD_TCUBE_USER: localizedAccessRight = "Tambah Pengguna TCube" ; break;
            case DELETE_TCUBE_USER: localizedAccessRight = "Pengguna Memadam TCube"; break;
            case EDIT_ACCESS_RIGHTS: localizedAccessRight = "Edit Hak Akses"; break;
            case UNLOCK_ACCOUNTS: localizedAccessRight = "Unlock Akaun"; break;
            case INACTIVATE_ACCOUNTS: localizedAccessRight = "Membunuh Akaun"; break;
            case VERIFY_STAKEHOLDER_ACCOUNTS: localizedAccessRight = "Mengesahkan Akaun Stakeholder"; break;
            case MANAGE_MAILBOX: localizedAccessRight = "Menguruskan Peti Mel"; break;
            case VIEW_ALL_STAFF: localizedAccessRight = "Lihat Semua Kakitangan"; break;
        }
        return localizedAccessRight;
    }
    
    // new accessRight for localized language template (copy and paste to use)
//    private static String getAccessRight_XX_YY(AccessRight accessRight) {
//        String localizedAccessRight = "";
//        
//        switch (accessRight) {
//            case CHINESE: localizedAccessRight = "" ; break;
//            case CANTONESE: localizedAccessRight = ""; break;
//            case HAINANESE: localizedAccessRight = ""; break;
//            case HAKKA: localizedAccessRight = ""; break;
//            case HOKKIEN: localizedAccessRight = ""; break;
//            case FUJIAN: localizedAccessRight = ""; break;
//            case SHANGHAI: localizedAccessRight = ""; break;
//            case TEOCHEW: localizedAccessRight = ""; break;
//            case XINJIANG: localizedAccessRight = ""; break;
//            case MALAY: localizedAccessRight = ""; break;
//            case INDIAN: localizedAccessRight = ""; break;
//            case WESTERN: localizedAccessRight = ""; break;
//            case JAPANESE: localizedAccessRight = ""; break;
//            case KOREAN: localizedAccessRight = ""; break;
//        }
//        return localizedAccessRight;
//    }
}
